<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" type="text/css" href="<%=path %>/static/css/css.css?1" />
<link rel="stylesheet" type="text/css" href="<%=path %>/static/jquery-ui/jquery-ui.min.css" />
<script type="text/javascript" src="<%=path %>/static/js/json2.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/static/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="<%=path %>/static/layer/layer.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/gridview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/formview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/tool.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/validate.js"></script>
<SCRIPT type="text/javascript">
    <!--

	var gridSetting = {
			id:'QhUserOperLogGrid',
			po:"QhUserOperLog",
			title:'用户行为列表',
			height:'auto',
			service:"uiServices!listSimple",
			tbId:"QhUserOperLogTb",
			pageInfo: {
				records: 12,//auto表示根据容器高度自动判断
				orderby : "id desc"
			},
			fields:[
			   {	name:'id',
					hide:true
			   },{
				   name: 'funName',
				   descs:"行为名称",
				   align:'left',
				   thstyle:"width:220px"
			   },{
                   name: 'srcIp',
                   descs:"来源IP",
                   align:'left',
                   thstyle:"width:140px"
               }
               ,{
                   name: 'srcPla',
                   descs:"渠道",
                   align:'left',
                   thstyle:"width:140px"
               }
               ,{
                   name: 'note',
                   descs:"备注",
                   align:'left'
               }
               ,{
                   name: 'createUser',
                   descs:"操作人",
                   align:'center',
                   thstyle:"width:120px"
               }
               ,{
                   name: 'createDateTime',
                   descs:"操作时间",
                   align:'center',
                   thstyle:"width:150px",
                   type:'date'
               }
			]
		};
	var grid;
    $(document).ready(function(){
    	grid = new GridView("list",gridSetting,"list");
		grid.init();
		var data = [];
		grid.load({data:data});

		ajustHeight();

		$("#deleteBtn").click(function(){
        		   grid.deletes("deleteMappedRoleNavis",function(ret){
                      if(ret==-1){
                         layer.msg("删除失败，请重试！");
                      }else{
                         layer.msg("删除" + ret.recordNum + "条记录！",function(ret){
                            grid.reload();
                         });
                      }
                   });
        		});

    });

    //-->
</SCRIPT>
</head>

<body>
<ul class=tab_nav>
  <li>
    <a class="current" href="javascript:void(0)">用户行为</a>
  </li>
</ul>
<div class="contrainer">
<div class="rcon2" >
<table class="search_tb">
   <tr>
      <td style="padding-left:15px;">
         <select name="funName" style="width:120px;" >
            <option value="">==请选择==</option>
            <option value="首次注册">首次注册</option>
            <option value="邀请">邀请</option>
            <option value="分享">分享</option>
            <option value="奖励">奖励</option>
            <option value="登陆">登陆</option>
            <option value="阅读">阅读</option>
         </select>
      </td>
      <td><input type="text" name="createUser" placeholder="操作人" /></td>
      <td>
         <div style="float:left">
            <input type="text" onclick="WdatePicker()" name="createDateTime" placeholder="开始时间" />-<input type="text" onclick="WdatePicker()" name="createDateTime" placeholder="结束时间" />
         </div>
         <input type="button" class="searchbtn" value="" id="queryBtn">
      </td>
      <td>
         <input type="button" class="btnblue" value="删除" id="deleteBtn">
      </td>
   </tr>
</table>
</div>
<div id="formview" class="rbox1"></div>
<div id="list" class="rbox2"></div>
</div>
<script type="text/javascript" src="<%=path %>/static/js/underscore.js"></script>
<script type='text/javascript' src='<%=path %>/static/My97DatePicker/WdatePicker.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/interface/BaseDwr.js'></script>
<script>
   $(function(){
      $("#queryBtn").click(function(){
         var funName = $(".search_tb").find("select[name=funName]").val();
             	var createUser = $(".search_tb").find(":input[name=createUser]").val();
                 var createDateTime1 = $(".search_tb").find(":input[name=createDateTime]:eq(0)").val();
             	var createDateTime2 = $(".search_tb").find(":input[name=createDateTime]:eq(1)").val();

             	var data = [];
             	if(funName!==""){
             		data.push({r:"=",name:'funName',value:funName});
             	}
             	if(createUser!==""){
                     data.push({r:"=",name:'createUser',value:createUser});
                 }
                 if(createDateTime1!==""){
                     data.push({r:">=",name:'createDateTime',value:createDateTime1});
                 }
                 if(createDateTime2!==""){
                     data.push({r:"<=",name:'createDateTime',value:createDateTime2});
                 }
             	grid.load({data:data});
             	ajustHeight();
      });
   });
   function afterLoad_QhUserOperLogTb(){
      $(".rcon2 .mtable tbody tr").each(function(){
         $srcPla=$(this).find("td[name=srcPla]");
         if($srcPla.text()=="qf_13"){
            $srcPla.text("推啊");
         }
         else if($srcPla.text()=="qf_8"){
            $srcPla.text("应用宝");
         }
      });
   }
</script>
</body>
</html>